Übung 1
David Straub
C:\Users\hm-abcd12ef
sudo apt install python python3-pip python3-venv
Test: in der Python-Eingabeaufforderung
import sys print(sys.executable)
Im Verzeichnis, in dem die virtuelle Umgebung angelegt werden soll, z.B. im Benutzer-Verzeichnis:
python -m venv cax-env
python3 -m venv cax-env
Aktivieren der virtuellen Umgebung:
cax-env\Scripts\activate
source cax-env/bin/activate
python -m pip install jupyterlab cadquery build123d jupyter-cadquery ocp-vscode
jupyter lab
test.ipynb
import jupyter_cadquery import build123d as bd bd.Box(30, 20, 10)
import jupyter_cadquery from cadquery import func as cq_func cq_func.box(30, 20, 10)
Hinweise:
cax-env\Scripts\python.exe
cax-env/bin/python
Box
import build123d as bd bd.Box(length=30, width=20, height=10)
bd.Box(30, 20, 10)
Cylinder
bd.Cylinder(radius=5, height=20)
Pos()
zylinder = bd.Cylinder(radius=5, height=10) bd.Pos(15, 0, 5) * zylinder
Pos(x, y, z)
*
vereinigung = quader + zylinder # Vereinigung (Union) differenz = quader - zylinder # Differenz (Difference) schnitt = quader & zylinder # Schnitt (Intersection)